package br.com.biavan.tudo;

import java.util.Random;

public class Apple implements Runnable{
	
	String name;
	int time;
	Random r = new Random();
	
	public Apple(String s) {
		name = s;
		time = r.nextInt(999);
	}
	
	public void run() {
		try {
			System.out.printf("%s está dormindo por %d\n", name, time);
			Thread.sleep(time);
			System.out.printf("%s acordei!\n", name);
		} catch (Exception e) {
			System.out.println("ERROR: " + e.getMessage());
		}
	}
	
}
